package spring.jpa.controller;

import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import spring.jpa.entity.Customer;
import spring.jpa.service.CustomerService;

@RestController
@RequiredArgsConstructor
public class CustomerController {
    final CustomerService customerService;

    @GetMapping(value = "/save")
    public Object save() {
        Customer customer = new Customer(null, "zhangsan", "123@gmail.com", 18);
        customerService.save(customer);
        return customer;
    }
}